﻿using System;
using System.Collections;
using System.Reflection;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using AnyOffice.Components;
using AnyOffice.DAL;
using log4net;
using Microsoft.ApplicationBlocks.Data;
namespace AnyOffice.general.mytable
{
    public partial class Migrated_note : System.Web.UI.UserControl
    {
        private static ILog  log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        protected void Page_Load(object sender, EventArgs e)
        {
        
            try
            {
                this.txtNote.Attributes.Add("onblur", "_setNote(this.value);");
                this.txtNote.Attributes.Add("onmouseout", "_setNote(this.value);");

                SqlConnection connection = new SqlConnection(ConfigManager.ConnectionString);
                string commandText = "SELECT [Note] FROM [dbo].[Users] WHERE [UserId] = '" + HttpContext.Current.User.Identity.Name + "'";
                object obj2 = SqlHelper.ExecuteScalar(connection, CommandType.Text, commandText);
                if ((obj2 != null) && (obj2 != DBNull.Value))
                {
                    this.txtNote.Value = obj2.ToString();
                }
                connection.Close();
            }
            catch (Exception exception)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("", exception);
                }
            }
        }
    }
}